package springannotaion;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.*;
import springannotaion.aspect.AspectTest;
import springannotaion.aspect.MyEnableAspect;
import springannotaion.bean.A2;
import springannotaion.bean.D2;
import springannotaion.bean.F2;
import springannotaion.compment22.ImportBeanDefinitionRegistrar1;
import springannotaion.compment22.MyImportSelector;
import springannotaion.compment22.WindowsCondition;

/**
 * @author: wyy-sss
 * @date: 2020-02-09 10:48
 **/
@Configuration
@ComponentScan("springannotaion")
@EnableAspectJAutoProxy
//@Import({ImportBeanDefinitionRegistrar1.class, MyImportSelector.class})
//@MyEnableAspect
public class AllConfig2 {

//	@Autowired
//	private A2 a2;
//	@Autowired
//	private D2 d2; D2 d2
  //D2.class,
	@Bean(initMethod = "sayHello")
	public A2 a2(){
		A2 a2 = new A2();
		a2.setId("a2222");
		a2.setName("aaaaaa222");
//		d2.setName("d222");
//		a2.setD2(d2);
		return a2;
	}
//
//	@Bean
//	//@Conditional(WindowsCondition.class)
//	public F2 f2(){
//		return new F2();
//	}
//
	@Bean
	public D2 d2(){
		return new D2();
	}

	@Bean
	public AspectTest aspectTest2(){
		return new AspectTest();
	}
}
